﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using anks.Components;
using pygs.Classes;

namespace pygs.Locator
{
    public abstract class CustomLocator : Component
    {
        public delegate void LocationHandler(CustomLocator locator, Location location);

        protected abstract Location GetLastLocation();
        public Location lastLocation { get { return GetLastLocation(); } }

        public abstract Location GetCurrentLocation();

        public abstract void Start();
        public abstract void Stop();

        protected abstract LocatorStatus GetStatus();
        public LocatorStatus status { get { return GetStatus(); } }

        public event LocationHandler NewLocation;
        public virtual void ProccessNewLocations()
        {
        }

        protected virtual void DoNewLocation(Location location)
        {
            if (NewLocation != null)
                NewLocation(this, location);
        }
    }
}
